package com.favccxx.ticketrule.domain.ticket.service;

import com.favccxx.ticketrule.domain.ticket.entity.Tourist;
import com.favccxx.ticketrule.infrastructure.constants.TicketDiscount;
import org.springframework.stereotype.Service;

@Service
public class TouristService {

    public TicketDiscount getDiscount(Tourist tourist){
        if(tourist == null){
            return TicketDiscount.NONE;
        }

        if(tourist.getAge()>=60 || tourist.getAge()<=7){
            return TicketDiscount.FREE;
        }else if(tourist.getAge()<=18){
            return TicketDiscount.HALF;
        }else{
            return TicketDiscount.NONE;
        }

    }

}
